package com.itheima.web;


import com.itheima.dto.SetmealDTO;
import com.itheima.service.SetmealService;
import com.itheima.support.PageResult;
import com.itheima.support.QueryPageBean;
import com.itheima.support.Result;
import org.apache.dubbo.config.annotation.DubboReference;

import org.springframework.web.bind.annotation.*;




@RestController
@RequestMapping("/setmeal")
public class SetmealController {
    @DubboReference
    private SetmealService setmealService;



    @PostMapping("/save")
    public boolean save(@RequestBody SetmealDTO setmealDTO){
        return setmealService.saveSetmeal(setmealDTO);
    }

    @PostMapping("/findByPage")
    public PageResult findByPage(@RequestBody QueryPageBean queryPageBean){
        return setmealService.findByPage(queryPageBean);
    }

    @GetMapping("/clear")
    public void clear(){
        setmealService.clear();
    }



}
